extends Node

signal language_changed(language: String)

var current_language: String = "zh"

var translations = {
	"zh": {
		"game_title": "冒险游戏",
		"start_game": "开始游戏",
		"settings": "设置",
		"language": "语言",
		"quit": "退出",
		"back": "返回",
		"chinese": "中文",
		"english": "English"
	},
	"en": {
		"game_title": "Adventure Game",
		"start_game": "Start Game",
		"settings": "Settings",
		"language": "Language",
		"quit": "Quit",
		"back": "Back",
		"chinese": "中文",
		"english": "English"
	}
}

func get_text(key: String) -> String:
	return translations[current_language][key]

func set_language(language: String) -> void:
	if language in translations:
		current_language = language
		emit_signal("language_changed", language) 
